home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include "source:aztec/glue.h"
- #define FOREVER while(1)
- #define KEYBOARD_TIMEOUT 0
- #define SUCCESS 1
- #define FAILURE 0
- #define sm sendmessage
- int Edit_Accounts(void);
-
- int GI2;
- struct User {
- char Name[31],Pass[9],Location[30],PhoneNumber[13];
- USHORT Slot_Number;
- USHORT Sec_Status,
- Sec_Board, /* File or Byte Ratio */
- Sec_Library, /* Ratio */
- Sec_Bulletin, /* Computer Type */
- Messages_Posted;
- /* Note ConfYM = the last msg you actually read, ConfRead is the same ?? */
- ULONG NewSinceDate, ConfRead1, ConfRead2, ConfRead3, ConfRead4,
- ConfRead5;
- UWORD XferProtocol, Filler2;
- UWORD Lcfiles,BadFiles;
- ULONG AccountDate;
- UWORD ScreenType, Filler1;
- char Conference_Access[10];
- USHORT Uploads, Downloads, ConfRJoin, Times_Called;
- long Time_Last_On, Time_Used, Time_Limit, Time_Total;
- ULONG Bytes_Download, Bytes_Upload, Daily_Bytes_Limit, Daily_Bytes_Dld;
- char Expert;
- ULONG ConfYM1, ConfYM2, ConfYM3, ConfYM4, ConfYM5, ConfYM6, ConfYM7,
- ConfYM8, ConfYM9;
- long BeginLogCall;
- UBYTE Protocol, UUCPA, LineLength, New_User;
- };
- UBYTE GSTR3[3000],GSTR2[3000],GSTR1[3000];
-
-
- main(int argc,char *argv[])
- {
- if(argc!=2)
- {
- printf("ACNT version 1.0, written by Joseph Hodge\n");
- printf("\n");
- exit(0);
- }
- Register(argv[1][0]-'0');
- Edit_Accounts();
- ShutDown();
- end();
- }
- struct User *hoozer;
- #define AEPutStr(x) sendmessage(x,0)
- #define LineInput(x,y,z,t) prompt(x,y,z)
- static UBYTE UUCPNumberInput(void)
- {
- AEPutStr(" \b");
- prompt("",GSTR1,1);
- return((UBYTE)atol(GSTR1));
- }
-
- static int NumberInput(void)
- {
- AEPutStr(" \b\b\b\b\b");
- prompt("",GSTR1,5);
- return((int)atol(GSTR1));
- }
-
- static ULONG LongNumberInput(void)
- {
- AEPutStr(" \b\b\b\b\b\b\b\b\b\b");
- LineInput("",GSTR1,10,KEYBOARD_TIMEOUT);
- return((ULONG)atol(GSTR1));
- }
-
- static void Display_Account(int who)
- {
- if(hoozer->Slot_Number!=0) {
- sprintf(GSTR1,"H ACTIVE [%hu] \r\n",hoozer->Slot_Number);
- AEPutStr(GSTR1);
-
- } else {
- sprintf(GSTR1,"HINACTIVE [%hu] \r\n",who);
- AEPutStr(GSTR1);
- }
-
- sprintf(GSTR1,"HA> Name: %-32s ",hoozer->Name);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"2HB> Loc.: %-29s\r\n",hoozer->Location);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"C> Pass ..........: %-8s\r\n",hoozer->Pass);
- AEPutStr(GSTR1);
-
-
- sprintf(GSTR1,"D> Phone Number ..: %-13s",hoozer->PhoneNumber);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"HE> Ratio .........: %-7hu\r\n",hoozer->Sec_Library);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"6HF> Area Name......: %s",hoozer->Conference_Access);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"HG> Ratio Type ....: %-5hu",hoozer->Sec_Board);
- AEPutStr(GSTR1);
- if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
- if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
- if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
-
- sprintf(GSTR1,"6HH> Sec_Level .....: %-5hu",hoozer->Sec_Status);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"HI> Uploads .......: %-10hu\r\n",hoozer->Uploads);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"6HJ> AutoReJoin ....: %-10hu",hoozer->ConfRJoin);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"HK> Downloads .....: %-10hu\r\n",hoozer->Downloads);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"6HL> Messages_Posted: %-7hu",hoozer->Messages_Posted);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"HM> Bytes Uled ....: %-10ld\r\n",hoozer->Bytes_Upload);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"6HN> New_User ......: %s #Calls: %-12ld",(hoozer->New_User?"Yes":"No "),hoozer->Times_Called);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"1HO> Bytes Dled ....: %-10ld\r\n",hoozer->Bytes_Download);
- AEPutStr(GSTR1);
-
- sprintf(GSTR2,"%s",ctime(&hoozer->Time_Last_On));
- GSTR2[24]='\0';
- sprintf(GSTR1,"9HLast Called ...: %s",GSTR2);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"1HQ> Byte Limit ....: %-10ld\r\n",hoozer->Daily_Bytes_Limit);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"39HComputer Type .: ");
- AEPutStr(GSTR1);
- AEPutStr("39HScreen Type ..: ");
- //sprintf(GSTR1,"%sScreenTypes.DEF",Cmds->BBSLoc);
- sprintf(GSTR2,"TITLE.%d",hoozer->ScreenType+1);
- AEPutStr("56H");
- /*if(GetFromIconStr(GSTR1,GSTR2,GSTR2))
- {
- sprintf(GSTR1,"%-16s",GSTR2);
- AEPutStr(GSTR1);
- }*/
- //(RTS)
-
- sprintf(GSTR1,"1HR> Time_Limit: [%-8lu] secs ",hoozer->Time_Limit);
- AEPutStr(GSTR1);
- sprintf(GSTR1," S> Time_Used: [%-8lu] secs T> UUCP: %d\r\n",hoozer->Time_Used,hoozer->UUCPA);
- AEPutStr(GSTR1);
- AEPutStr("\r\n");
-
- AEPutStr("X=EXIT-NOSAVE TAB=Cont ~=SAVE 1-6=Presets 9=RE-ACTIVATE DEL=DELETE\r\n");
- }
-
- static void Display_Account_Info(int who)
- {
- if(hoozer->Slot_Number!=0) {
- sprintf(GSTR1,"H ACTIVE [%hu] \r\n",hoozer->Slot_Number);
- AEPutStr(GSTR1);
- } else {
- sprintf(GSTR1,"HINACTIVE [%hu] \r\n",who);
- AEPutStr(GSTR1);
- }
-
- sprintf(GSTR1,"0H%-32s",hoozer->Name);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"1H%-29s",hoozer->Location);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"1H%-8s",hoozer->Pass);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"1H%-13s",hoozer->PhoneNumber);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"1H%-7hu",hoozer->Sec_Library);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"6H%-10s",hoozer->Conference_Access);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"1H%-5hu",hoozer->Sec_Board);
- AEPutStr(GSTR1);
- if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
- if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
- if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
-
- sprintf(GSTR1,"6H%-5hu",hoozer->Sec_Status);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"1H%-10hu",hoozer->Uploads);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"6H%-7hu",hoozer->ConfRJoin);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"1H%-10hu",hoozer->Downloads);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"6H%-7hu",hoozer->Messages_Posted);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"1H%-10ld",hoozer->Bytes_Upload);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"6H%s #Calls: %-12ld",(hoozer->New_User?"Yes":"No "),hoozer->Times_Called);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"21H%-10ld",hoozer->Bytes_Download);
- AEPutStr(GSTR1);
-
- sprintf(GSTR2,"%s",ctime(&hoozer->Time_Last_On));
- GSTR2[24]='\0';
- sprintf(GSTR1,"6H%s",GSTR2);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"21H%-10ld",hoozer->Daily_Bytes_Limit);
- AEPutStr(GSTR1);
-
- //sprintf(GSTR1,"%sScreenTypes.DEF",Cmds->BBSLoc);
- sprintf(GSTR2,"TITLE.%d",hoozer->ScreenType+1);
- AEPutStr("56H");
- /*if(GetFromIconStr(GSTR1,GSTR2,GSTR2))
- {
- sprintf(GSTR1,"%-16s",GSTR2);
- AEPutStr(GSTR1);
- }*/
-
- //(RTS)
-
- sprintf(GSTR1,"17H%-6lu",hoozer->Time_Limit);
- AEPutStr(GSTR1);
- sprintf(GSTR1,"51H%-6lu",hoozer->Time_Used);
- AEPutStr(GSTR1);
-
- sprintf(GSTR1,"76H%d",hoozer->UUCPA);
- AEPutStr(GSTR1);
-
- }
-
-
- UWORD EditInfo(int which)
- {
- int flag;
- int command;
- char temp[100];
- //NOFKeys=1;
- Display_Account(which);
- strcpy(GSTR1,hoozer->Name);
- (void)strupr(GSTR1);
-
- FOREVER {
- flag=0;
- hotkey("",temp); command=temp[0];
- switch(command) {
- case 'X': /* NO-SAVE */
- AEPutStr("No-Save\r\n");
- flag=1;
- break;
- case '\t':
- flag=2;
- break;
- case '\177': /* DELETE */
- AEPutStr("Delete\r\n");
- GI2=which;
- hoozer->Slot_Number=0;
-
- /* changed from ForceSave_Account Thu Jan 30 04:17:48 1992 */
- Save_Account(GI2);
- //DeleteConfAccess(hoozer->Slot_Number);
- Display_Account_Info(which);
- flag=0;
- break;
- case ' ':
- Display_Account_Info(which);
- break;
- case '+':
- which=which+1;
- if((hoozer=Load_Account(which))!=NULL)
- Display_Account_Info(which);
- else {
- which=1;
- hoozer=Load_Account(which);
- Display_Account_Info(which);
- }
- break;
- case '-':
- which=which-1;
- if(which<1) which=1;
- hoozer=Load_Account(which);
- Display_Account_Info(which);
- break;
- case '~': /* SAVE */
- AEPutStr("Save\r\n");
- hoozer->New_User=0;
- Display_Account_Info(which);
- Save_Account(which); /* 1 = FORCE SAVE */
- break;
- case '8': case '7':
- case '6': case '5': case '4': case '3':
- case '2': /* VALIDATE */
- case '1':
- break;
-
- case '9': /* RE-ACTIVATE */
- AEPutStr("Re-Activate\r\n");
- hoozer->Slot_Number=which;
- flag=0;
- break;
- case 'a': case 'A': /* NAME */
- AEPutStr("0H");
- LineInput(hoozer->Name,hoozer->Name,30,KEYBOARD_TIMEOUT);
- strcpy(GSTR1,hoozer->Name);
- (void)strupr(GSTR1);
- flag=0;
- break;
- case 'b': case 'B': /* Location */
- AEPutStr("1H");
- LineInput(hoozer->Location,
- hoozer->Location,29,KEYBOARD_TIMEOUT);
- flag=0;
- break;
- case 'c': case 'C': /* PASS */
- AEPutStr("1H");
- LineInput(hoozer->Pass,hoozer->Pass,8,KEYBOARD_TIMEOUT);
- flag=0;
- break;
- case 'd': case 'D': /* Phone number */
- AEPutStr("1H");
- LineInput(hoozer->PhoneNumber,
- hoozer->PhoneNumber,12,KEYBOARD_TIMEOUT);
- flag=0;
- break;
- case 'e': case 'E': /* RATIO */
- AEPutStr("1H");
- hoozer->Sec_Library=NumberInput();
- flag=0;
- break;
- case 'f': case 'F': /* conference access */
- AEPutStr("6H");
- LineInput(hoozer->Conference_Access,hoozer->Conference_Access,9,KEYBOARD_TIMEOUT);
- flag=0;
- break;
- case 'g': case 'G': /* Ratio Type */
- AEPutStr("1H");
- hoozer->Sec_Board=NumberInput();
- if(hoozer->Sec_Board<0 || hoozer->Sec_Board > 2)
- {
- AEPutStr("\a"); hoozer->Sec_Board=0; }
- sprintf(GSTR1,"HG> Ratio Type ....: %-5hu",hoozer->Sec_Board);
- AEPutStr(GSTR1);
- if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
- if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
- if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
-
- flag=0;
- break;
- case 'h': case 'H': /* SEC_Level */
-
- AEPutStr("6H");
- hoozer->Sec_Status=NumberInput();
- flag=0;
- break;
- case 'i': case 'I': /* UPLOADS */
- AEPutStr("1H");
- hoozer->Uploads=NumberInput();
- flag=0;
- break;
- case 'j': case 'J': /* conference ReJoin */
- AEPutStr("6H");
- hoozer->ConfRJoin=NumberInput();
- flag=0;
- break;
- case 'k': case 'K': /* DOWNLOADS */
- AEPutStr("1H");
- hoozer->Downloads=NumberInput();
- flag=0;
- break;
- case 'l': case 'L': /* MESSAGES_POSTED */
- AEPutStr("6H");
- hoozer->Messages_Posted=NumberInput();
- flag=0;
- break;
- case 'm': case 'M': /* Bytes Uploaded */
- AEPutStr("1H");
- hoozer->Bytes_Upload=LongNumberInput();
- flag=0;
- break;
- case '#':
- AEPutStr("8H");
- hoozer->Times_Called=LongNumberInput();
- flag=0;
- break;
- case 'o': case 'O': /* Bytes Downloaded */
- AEPutStr("21H");
- hoozer->Bytes_Download=LongNumberInput();
- flag=0;
- break;
- case 'q': case 'Q': /* Daily Bytes Limit */
- AEPutStr("21H");
- hoozer->Daily_Bytes_Limit=LongNumberInput();
- flag=0;
- break;
- case 'r': case 'R': /* Time_Limit */
- AEPutStr("17H");
- hoozer->Time_Limit=LongNumberInput();
- if(hoozer->Time_Total<hoozer->Time_Limit)
- hoozer->Time_Total=hoozer->Time_Limit;
- flag=0;
- break;
- case 's': case 'S': /* TIME_USED */
-
- AEPutStr("51H");
- hoozer->Time_Used=LongNumberInput();
- flag=0;
- break;
- case 't': case 'T':
- AEPutStr("76H");
- hoozer->UUCPA=UUCPNumberInput();
- flag=0;
- break;
-
- default:
- flag=0;
- break;
- }
- AEPutStr("1H");
- if(flag) { break; }
- }
- //NOFKeys=0;
- return((UWORD)flag);
- }
-
- WORD CheckNEdit(WORD which)
- {
- WORD stat;
-
- AEPutStr("\014");
- hoozer=Load_Account(which);
- if(hoozer==NULL)
- {
- AEPutStr("Warning, error while loading account\r\n");
- return(FAILURE);
- }
- AEPutStr("\017\014");
- stat=EditInfo(which);
- return(stat);
- }
-
- int Edit_Accounts(void)
- {
- WORD stat;
- int which;
-
- FOREVER {
- AEPutStr("\r\nEnter Account Number ? ");
- LineInput("",GSTR3,5,KEYBOARD_TIMEOUT);
- if(GSTR3[0]=='\0') { goto RETURNF; }
-
-
- which=(int)atol(GSTR3);
- if(which<=0) goto RETURNF;
- CheckNEdit(which);
- }
- RETURNF:
- AEPutStr("\r\n");
- return(SUCCESS);
- }
-
- void LastCommand(void)
- {
- sm("",1);
- sm("",1);
- }
-
- void end(void)
- {
- exit(0);
- }